import 'package:flutter/material.dart';

void main() {
  runApp(MainPage());
}
class MainPage extends StatelessWidget{
  const MainPage({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context){
    return MaterialApp(
      home:Scaffold(
        body:Container(
          height: MediaQuery.of(context).size.height,
          width: MediaQuery.of(context).size.width,
          decoration: BoxDecoration(
            color: Colors.grey,
          ),
          child:Flex(direction:Axis.vertical,
          children:[
            Expanded(
              flex:2,
              child:Container(
                width:100,
                color: Colors.blue,
              ),
              ),
            Expanded(
              flex:1,
              child:Container(
                width:100,
                color: Colors.red,
              ),
            ),
            Expanded(
              flex:1,
              child:Container(              
                width:100,
                color: Colors.green,
              ),
            ),
          ]
          )
        )
        )
    );
  }
}